package com.yycx.module.bus.provider.handler.haiying.order.waybill;

import com.yycx.common.base.entity.EntityMap;
import com.yycx.common.mybatis.interceptor.PageInterceptor;
import com.yycx.common.mybatis.model.PageParams;
import com.yycx.common.mybatis.model.ResultBody;
import com.yycx.common.mybatis.query.CriteriaQuery;
import com.yycx.common.security.OpenHelper;
import com.yycx.module.bus.client.entity.hy.HyOrder;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 已取消订单列表
 *
 * @author zyf
 */
@Component
public class HyWaybillTab5ListHandler implements PageInterceptor<HyOrder> {


    @Override
    public ResultBody validate(CriteriaQuery cq, EntityMap params) {
        return ResultBody.ok();
    }

    @Override
    public void prepare(CriteriaQuery cq, PageParams pageParams, EntityMap params) {
        cq.eq(HyOrder.class, "companyId",OpenHelper.getCompanyId());
        cq.eq(true,"outPrintTag", -1);
        cq.like(HyOrder.class,"customAddress");
        cq.orderByDesc("ho.createTime");
    }

    @Override
    public List<EntityMap> complete(CriteriaQuery<HyOrder> cq, List<EntityMap> result, EntityMap extra) {

        return result;
    }

}
